<%= form_for(:session, url: sessions_path, builder: CustomFormBuilder, :html => {class: 'table-bordered border-left margin-bottom20'}) do |f| %>
  <div class="top-title-container">
    <%= link_to 'Home', root_path %>
  </div>

  <div class="padding10">
    <h4>用户登录</h4>
    <hr/>
    <% if flash.now[:error] || flash[:error] then %>
      <%= render 'shared/error_messages', object: {errors: [flash.now[:error] ? flash.now[:error] : flash[:error]]} %>
    <% end %>

    <%= f.text_field :email, label: '电子邮箱：', label_class: 'form-label width100', required: true, required_mark_before_label: true %>
    <%= f.password_field :password, label: '登录密码：', label_class: 'form-label width100', required: true, required_mark_before_label: true %>

    <div class="field">
      <%= f.submit '现在登录', :class => 'btn btn-primary' %>
      <%= link_to '注册新用户', signup_path, :class => 'btn btn-primary' %>
    </div>

    <div style="margin-top: 35px;">
      <p class="text-success">还可以使用其他帐号登录（请点击相应图标进入登录页面）：</p>
      <%= link_to(add_cdn_path(image_tag 'github_logo.gif', alt: 'github'), auth_github_path) %>
    </div>
  </div>

  <div class="bottom-title-container">
    <%= link_to 'Home', root_path %>
  </div>
<% end %>
